﻿@page "/account"

@inject IStringLocalizer<Account> L

<FshTitle Title="@L["Account"]" Description="@L["Manage your account"]" />

<MudTabs Elevation="25" Color="Color.Transparent" Rounded="true" PanelClass="mt-6">
    <MudTabPanel Text="@L["Profile"]">
        <Profile />
    </MudTabPanel>
    @if (!SecurityTabHidden)
    {
        <MudTabPanel Text="@L["Security"]">
            <Security />
        </MudTabPanel>
    }
</MudTabs>

@code
{
    [Inject]
    public IAuthenticationService AuthService { get; set; } = default!;

    public bool SecurityTabHidden { get; set; } = false;

    protected override void OnInitialized()
    {
        if (AuthService.ProviderType == AuthProvider.AzureAd)
        {
            SecurityTabHidden = true;
        }
    }
}